Skip to content

Conversation

@vsraccubits
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @vsraccubits, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new data seeding utility to support observability analytics. It provides a Python script to populate a ClickHouse database with sample OpenTelemetry trace data, which is essential for testing the data pipeline that transforms raw traces into aggregated inference facts and metrics. This enhancement is crucial for validating the accuracy and reliability of the system's observability and analytics features.

Highlights

  • New Data Seeder for Observability: A new Python script, seed_otel_traces.py, has been added to facilitate seeding OpenTelemetry (OTel) trace data into a ClickHouse database for testing purposes.
  • Sample OTel Trace Data: A comprehensive JSON fixture, otel_traces_sample.json, is introduced, containing various sample OTel trace spans. This data is designed to test the otel_traces to InferenceFact pipeline.
  • ClickHouse Integration and Utilities: The seeder script includes robust logic to convert and format complex JSON trace data, including nested maps and arrays, into ClickHouse-compatible SQL INSERT statements. It also provides functions to clear and verify data in ClickHouse tables.
  • Enhanced Testing Capabilities: This feature enables more thorough testing of the data processing pipeline, ensuring that raw OTel traces are correctly transformed and aggregated into InferenceFact and InferenceMetrics tables within ClickHouse.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a data seeder for OpenTelemetry traces to facilitate testing of the observability to analytics pipeline. It adds a Python script for seeding data and a corresponding JSON file with sample traces. While the overall implementation is good, I've identified a couple of issues. The sample JSON data contains malformed JSON strings which could lead to parsing errors in downstream consumers. Additionally, the seeder script contains some unnecessary code that should be removed to improve clarity and maintainability.

"model_inference.output": "[{\"type\":\"text\",\"text\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\"}]",
"model_inference.output_tokens": "31",
"model_inference.raw_request": "{\"messages\":[{\"role\":\"user\",\"content\":\"Summarize the given texts stream\"}],\"model\":\"gpt-4.1\",\"stream\":false,\"logprobs\":false}",
"model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\"31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The JSON string assigned to model_inference.raw_response is malformed. The completion_tokens key is missing a colon before its value (\"completion_tokens\"31). This will cause JSON parsing errors for any consumer of this data.

Suggested change
"model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\"31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}",
"model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\":31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}",

"model_inference.output": "[{\"type\":\"text\",\"text\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\"}]",
"model_inference.output_tokens": "31",
"model_inference.raw_request": "{\"messages\":[{\"role\":\"user\",\"content\":\"Summarize the given texts stream\"}],\"model\":\"gpt-4.1\",\"stream\":false,\"logprobs\":false}",
"model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\"31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Similar to a previous entry, the JSON string for model_inference.raw_response is malformed. The completion_tokens key is missing a colon.

Suggested change
"model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\"31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}",
"model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\":31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}",

Comment on lines +132 to +134
# Write SQL to temp file to avoid shell escaping issues
sql_file = Path("/tmp/otel_seed.sql")
sql_file.write_text(sql)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These lines write the generated SQL to a temporary file /tmp/otel_seed.sql, but this file is never used. The subprocess.run call on line 142 passes the sql string directly to the input parameter, which is then piped to the stdin of the clickhouse-client. The comment on line 132 is also misleading. This unnecessary file I/O and dead code should be removed to improve clarity and maintainability.

@vsraccubits vsraccubits marked this pull request as draft January 10, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants